<template>
  <div>
     <div class="recoment-title">热门推荐</div>
     <ul>
         <li class="item border-bottom"
          v-for="item of recommendList"
           :key="item.id"
           @click="toDetail(item.id)">
             <div class="item-img-wrapper">
                 <img class="item-img" :src="item.recomImg" >
             </div>
             <div class="item-info">
                 <p class="item-title">{{item.title}}</p>
                 <p class="item-appraise">{{item.appraise}}条评论</p>
                 <div class="item-like-price">
                     <span class="item-price" >
                      ¥
                      <em class="item-price-num">{{item.price}}</em>
                     </span>
                     起
                     <span class="item-address">{{item.address}}</span>
                 </div>
             </div>
         </li>
     </ul>
  </div>
</template>

<script>
export default {
  name: 'Recomment',
  props: {
    recommendList: Array
  },
  methods: {
    toDetail (detailId) {
      this.$router.push({'name': 'detail', params: { id: detailId }})
    }
  }
}
</script>

<style lang="stylus" scoped>
@import '~style/varibles.styl'
@import '~style/mixins.styl'
.recoment-title
  line-height .8rem
  text-indent .2rem
  background #eee
.item
  display flex
  overflow hidden
  height 1.9rem
  position relative
  .item-img-wrapper
    width 1.7rem
    height 1.7rem
    padding .1rem
    position absolute
    overflow hidden
    top 0
    left 0
    .item-img
      height 100%
      display: block
  .item-info
    flex 1
    padding-left 2rem
    padding-top .2rem
    padding-bottom .3rem
    min-width 0
    .item-title
      color #212121
      font-size .32rem
      line-height: 0.44rem
      padding-bottom .18rem
      elllipsis()
    .item-appraise
      font-size .24rem
      padding-bottom .3rem
      color #616161
      line-height .34rem
    .item-like-price
      position relative
      color #616161
      font-size .24rem
      line-height .4rem
      .item-price
        color #ff8300
        .item-price-num
          font-size .4rem
      .item-address
        position absolute
        right .2rem
</style>
